name: pre-commit run_id: commands[2] env HOME: /home/jenkins env LANG: C.UTF-8 env PATH: /w/workspace/transportpce-tox-verify-transportpce-master/.tox/pre-commit/bin:/opt/pyenv/bin:/tmp/venv-bx7u/bin:/opt/pyenv/shims:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin env PYTHONHASHSEED: 3474707007 env PIP_DISABLE_PIP_VERSION_CHECK: 1 env PYTHONIOENCODING: utf-8 env OLM_TIMER1: 3000 env OLM_TIMER2: 2000 env TOX_ENV_NAME: pre-commit env TOX_WORK_DIR: /w/workspace/transportpce-tox-verify-transportpce-master/.tox env TOX_ENV_DIR: /w/workspace/transportpce-tox-verify-transportpce-master/.tox/pre-commit env VIRTUAL_ENV: /w/workspace/transportpce-tox-verify-transportpce-master/.tox/pre-commit metadata pid: 29150 cwd: /w/workspace/transportpce-tox-verify-transportpce-master/tests allow: /w/workspace/transportpce-tox-verify-transportpce-master/.tox/pre-commit/bin/*:sh:cpan:sudo:which:fixCIcentOS8reposMirrors.sh cmd: pre-commit run --all-files --show-diff-on-failure exit_code: 1 [WARNING] hook id `remove-tabs` uses deprecated stage names (commit) which will be removed in a future version. run: `pre-commit migrate-config` to automatically fix this. [WARNING] hook id `perltidy` uses deprecated stage names (commit) which will be removed in a future version. run: `pre-commit migrate-config` to automatically fix this. [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. [WARNING] repo `https://github.com/pre-commit/pre-commit-hooks` uses deprecated stage names (commit, push) which will be removed in a future version. Hint: often `pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks` will fix this. if it does not -- consider reporting an issue to that repo. [INFO] Initializing environment for https://github.com/jorisroovers/gitlint. [INFO] Initializing environment for https://github.com/jorisroovers/gitlint:./gitlint-core[trusted-deps]. [INFO] Initializing environment for https://github.com/Lucas-C/pre-commit-hooks. [INFO] Initializing environment for https://github.com/pre-commit/mirrors-autopep8. [INFO] Initializing environment for https://github.com/perltidy/perltidy. [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/pre-commit/mirrors-autopep8. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/perltidy/perltidy. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... trim trailing whitespace.................................................Passed Tabs remover.............................................................Failed - hook id: remove-tabs - exit code: 1 - files were modified by this hook Substituting tabs in: tests/sample_configs/openroadm/OC/sample-openconfig-mpdr.xml by 4 whitespaces Tabs have been successfully removed. Now aborting the commit. You can check the changes made. Then simply "git add --update ." and re-commit autopep8.................................................................Failed - hook id: autopep8 - files were modified by this hook perltidy.................................................................Passed pre-commit hook(s) made changes. If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`. To run `pre-commit` as part of git workflow, use `pre-commit install`. All changes made by hooks: diff --git a/tests/sample_configs/openroadm/OC/sample-openconfig-mpdr.xml b/tests/sample_configs/openroadm/OC/sample-openconfig-mpdr.xml index 147cc8ff..0b00d31d 100644 --- a/tests/sample_configs/openroadm/OC/sample-openconfig-mpdr.xml +++ b/tests/sample_configs/openroadm/OC/sample-openconfig-mpdr.xml @@ -12,7 +12,7 @@ - + 24300101 24300101 diff --git a/tests/transportpce_tests/OC/test01_portmapping.py b/tests/transportpce_tests/OC/test01_portmapping.py index 21783e39..463a1839 100644 --- a/tests/transportpce_tests/OC/test01_portmapping.py +++ b/tests/transportpce_tests/OC/test01_portmapping.py @@ -122,7 +122,8 @@ class TransportpceOCPortMappingTesting(unittest.TestCase): len(response['switching-pool-lcp'][0]['non-blocking-list'])) actual_lcp_list = response['switching-pool-lcp'][0]['non-blocking-list'][0]['lcp-list'] sorted_actual_lcp_list = sorted(actual_lcp_list) - expected_lcp_list = sorted(['XPDR1-CLIENT4', 'XPDR1-CLIENT3', 'XPDR1-NETWORK5', 'XPDR1-CLIENT2', 'XPDR1-CLIENT1']) + expected_lcp_list = sorted(['XPDR1-CLIENT4', 'XPDR1-CLIENT3', + 'XPDR1-NETWORK5', 'XPDR1-CLIENT2', 'XPDR1-CLIENT1']) self.assertEqual(sorted_actual_lcp_list, expected_lcp_list) def test_09_check_mccapprofile(self): @@ -137,6 +138,5 @@ class TransportpceOCPortMappingTesting(unittest.TestCase): self.assertIn(response.status_code, (requests.codes.ok, requests.codes.no_content)) - if __name__ == '__main__': unittest.main(verbosity=2) diff --git a/tests/transportpce_tests/common/test_utils.py b/tests/transportpce_tests/common/test_utils.py index 40a07a09..08a543e3 100644 --- a/tests/transportpce_tests/common/test_utils.py +++ b/tests/transportpce_tests/common/test_utils.py @@ -366,6 +366,7 @@ def mount_device(node: str, sim: str): # TODO an else-clause to abort test would probably be nice here return response + def metadata_input(): url = {'rfc8040': '{}/data/open-terminal-meta-data:open-terminal-meta-data', 'draft-bierman02': '{}/config/data/open-terminal-meta-data:open-terminal-meta-data'} @@ -460,6 +461,7 @@ def metadata_input(): response = put_request(url[RESTCONF_VERSION], body) return response + def catlog_input(): url = {'rfc8040': '{}/operations/org-openroadm-service:add-specific-operational-modes-to-catalog', 'draft-bierman02': '{}/config/operations/org-openroadm-service:add-specific-operational-modes-to-catalog'} @@ -680,12 +682,14 @@ def del_portmapping(): response = delete_request(url[RESTCONF_VERSION].format('{}')) return {'status_code': response.status_code} + def del_metadata(): url = {'rfc8040': '{}/data/open-terminal-meta-data:open-terminal-meta-data', 'draft-bierman02': '{}/config/data/open-terminal-meta-data:open-terminal-meta-data'} response = delete_request(url[RESTCONF_VERSION].format('{}')) return {'status_code': response.status_code} + def get_portmapping_node_attr(node: str, attr: str, value: str): # pylint: disable=consider-using-f-string url = {'rfc8040': '{}/data/transportpce-portmapping:network/nodes={}',